import request from '@/utils/request'

import { jdyadmin } from '@/settings'
/**
 * 外贸报表发货源数据
 * @param {*} data 
 */

// 查询报表发货单
export function getfahuo(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/seleteWaimaoFahuo`,
    method: 'post',
    data
  })
}

// 新增报表发货单
export function addfahuo(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/addWaimaoFahuo`,
    method: 'post',
    data
  })
}

// 修改报表发货单
export function writefahuo(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/updateWaimaoFahuo`,
    method: 'post',
    data
  })
}

// 删除报表发货单
export function deletefahuo(id){
  return request({
    url: `${jdyadmin}/waimaoFahuo/deleteWaimaoFahuo/${id}`,
    method: 'delete'
  })
}

// 导入报表发货单
export function importfahuo(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/addfahuo`,
    method: 'post',
    data
  })
}

// 欠款单导出
export function exportqiankuan(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/debtExcle`,
    method: 'post',
    data
  })
}

// 分类导出
export function exportfenlei(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/seleteAlllistgroupby`,
    method: 'post',
    data
  })
}

// 客户排名表
export function kehupaiming(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/seleteCompletion`,
    method: 'post',
    data
  })
}

// 客户排名表2
export function kehupaiming2(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/seleteTranking`,
    method: 'post',
    data
  })
}

// 销售区域统计表
export function xiaoshouquyu(data){
  return request({
    url: `${jdyadmin}/waimaoFahuo/seletetSalesErritory`,
    method: 'post',
    data
  })
}


/**
 * -------------------外贸报表回款源数据------------------------
 */

 // 导入报表回款单
export function importhuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoHuikuan/addhuikuan`,
    method: 'post',
    data
  })
}
// 查询报表回款单
export function gethuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoHuikuan/seleteHuikuan`,
    method: 'post',
    data
  })
}

// 新增报表回款单
export function addhuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoHuikuan/addhuikuans`,
    method: 'post',
    data
  })
}

// 修改报表回款单
export function writehuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoHuikuan/updatehuikuan`,
    method: 'post',
    data
  })
}

// 删除报表回款单
export function deletehuikuan(id){
  return request({
    url: `${jdyadmin}/waimaoHuikuan/deletehuikuan/${id}`,
    method: 'delete'
  })
}

/**
 * ---------------------------------------------------
 * ---------------------地区分类-----------------------
 * ---------------------------------------------------
 */
// 导入地区分类
export function importDiqu(data){
  return request({
    url: `${jdyadmin}/waimaoArea/addexclewaimaoArea`,
    method: 'post',
    data
  })
}

// 查询地区分类
export function selectDiqu(data){
  return request({
    url: `${jdyadmin}/waimaoArea/seleteWaimaoArea`,
    method: 'post',
    data
  })
}

// 更新地区分类
export function updateDiqu(data){
  return request({
    url: `${jdyadmin}/waimaoArea/updateWaimaoArea`,
    method: 'post',
    data
  })
}

// 增加地区分类
export function addDiqu(data){
  return request({
    url: `${jdyadmin}/waimaoArea/addWaimaoArea`,
    method: 'post',
    data
  })
}

// 查询地区分类
export function deleteDiqu(id){
  return request({
    url: `${jdyadmin}/waimaoArea/deleteWaimaoArea/${id}`,
    method: 'delete'
  })
}


/**
 * ---------------------------------------------------
 * ---------------------提成包装-----------------------
 * ---------------------------------------------------
 */
// 导入提成包装
export function importBaozhuang(data){
  return request({
    url: `${jdyadmin}/waimaoTichengBaozhuang/addBatchTichengBaozhuang`,
    method: 'post',
    data
  })
}

// 新增提成包装
export function addBaozhuang(data){
  return request({
    url: `${jdyadmin}/waimaoTichengBaozhuang/addTichengBaozhuang`,
    method: 'post',
    data
  })
}

// 查询提成包装
export function selectBaozhuang(data){
  return request({
    url: `${jdyadmin}/waimaoTichengBaozhuang/seleteTichengBaozhuang`,
    method: 'post',
    data
  })
}

// 更新提成包装
export function updateBaozhuang(data){
  return request({
    url: `${jdyadmin}/waimaoTichengBaozhuang/updateTichengBaozhuang`,
    method: 'post',
    data
  })
}

// 删除提成包装
export function deleteBaozhuang(id){
  return request({
    url: `${jdyadmin}/waimaoTichengBaozhuang/deleteTichengBaozhuang/${id}`,
    method: 'delete'
  })
}

/**
 * ---------------------------------------------------
 * ---------------------提成发货-----------------------
 * ---------------------------------------------------
 */
// 导入提成发货信息
export function importTiFahuo(data){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/addBatchTichengFahuo`,
    method: 'post',
    data
  })
}

// 新增提成发货信息
export function addTiFahuo(data){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/addTichengFahuo`,
    method: 'post',
    data
  })
}

// 查询提成发货信息
export function selectTiFahuo(data){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/seleteTichengFahuo`,
    method: 'post',
    data
  })
}

// 查询提成发货信息
export function updateTiFahuo(data){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/updateTichengFahuo`,
    method: 'post',
    data
  })
}

// 删除提成发货信息
export function deleteTiFahuo(id){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/deleteTichengFahuo/${id}`,
    method: 'delete'
  })
}

// 计算发货信息第一步
export function jisuanOne(data){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/detailslist`,
    method: 'post',
    data
  })
}

// 计算发货信息第二步
export function jisuanTwo(data){
  return request({
    url: `${jdyadmin}/waimaoTichengFahuo/list`,
    method: 'post',
    data
  })
}


/**
 * ---------------------------------------------------
 * ---------------------提成回款-----------------------
 * ---------------------------------------------------
 */
// 导入提成回款
export function importTichengHuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoTichengHuikuan/addBatchTichengFahuo`,
    method: 'post',
    data
  })
}

// 新增提成回款
export function addTichengHuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoTichengHuikuan/addTichengFahuo`,
    method: 'post',
    data
  })
}

// 查询提成回款
export function selectTichengHuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoTichengHuikuan/seleteTichengFahuo`,
    method: 'post',
    data
  })
}

// 更新提成回款
export function updateTichengHuikuan(data){
  return request({
    url: `${jdyadmin}/waimaoTichengHuikuan/updateTichengFahuo`,
    method: 'post',
    data
  })
}

// 删除提成回款
export function deleteTichengHuikuan(id){
  return request({
    url: `${jdyadmin}/waimaoTichengHuikuan/deleteTichengFahuo/${id}`,
    method: 'delete'
  })
}

/**
 * ---------------------------------------------------
 * ---------------------提成基价-----------------------
 * ---------------------------------------------------
 */
// 导入基价
export function importJijia(data){
  return request({
    url: `${jdyadmin}/waimaoTichengJijiabiao/addBatchTichengFahuo`,
    method: 'post',
    data
  })
}

// 新增基价
export function addJijia(data){
  return request({
    url: `${jdyadmin}/waimaoTichengJijiabiao/addTichengHuilv`,
    method: 'post',
    data
  })
}

// 查询基价
export function selectJijia(data){
  return request({
    url: `${jdyadmin}/waimaoTichengJijiabiao/seleteTichengHuilv`,
    method: 'post',
    data
  })
}

// 更新基价
export function updateJijia(data){
  return request({
    url: `${jdyadmin}/waimaoTichengJijiabiao/updateTichengHuilv`,
    method: 'post',
    data
  })
}

// 删除基价
export function deleteJijia(id){
  return request({
    url: `${jdyadmin}/waimaoTichengJijiabiao/deleteTichengHuilv/${id}`,
    method: 'delete'
  })
}

/**
 * ---------------------------------------------------
 * ---------------------提成系数-----------------------
 * ---------------------------------------------------
 */
// 导入提成系数
export function importTixishu(data){
  return request({
    url: `${jdyadmin}/waimaoTichengXishu/addBatchTichengXishu`,
    method: 'post',
    data
  })
}

// 新增提成系数
export function addTixishu(data){
  return request({
    url: `${jdyadmin}/waimaoTichengXishu/addTichengXishu`,
    method: 'post',
    data
  })
}

// 查询提成系数
export function selectTixishu(data){
  return request({
    url: `${jdyadmin}/waimaoTichengXishu/seleteTichengXishu`,
    method: 'post',
    data
  })
}

// 更新提成系数
export function updateTixishu(data){
  return request({
    url: `${jdyadmin}/waimaoTichengXishu/updateTichengXishu`,
    method: 'post',
    data
  })
}

// 删除提成系数
export function deleteTixishu(id){
  return request({
    url: `${jdyadmin}/waimaoTichengXishu/deleteTichengXishu/${id}`,
    method: 'delete'
  })
}

/**
 * ---------------------------------------------------
 * --------------------汇率接口------------------------
 * ---------------------------------------------------
 */
// 导入汇率列表
export function importWaimaoHuilv(data){
	return request({
		url: `${jdyadmin}/waimaoTichengHuilv/addBatchTichengFahuo`,
		method: 'post',
		data
	})
}

// 获取汇率列表
export function getWaimaoHuilv(data){
	return request({
		url: `${jdyadmin}/waimaoTichengHuilv/seleteTichengHuilv`,
		method: 'post',
		data
	})
}

// 新增汇率
export function addWaimaoHuilv(data){
	return request({
		url: `${jdyadmin}/waimaoTichengHuilv/addTichengHuilv`,
		method: 'post',
		data
	})
}

// 更新汇率列表
export function updateWaimaoHuilvlist(data){
	return request({
		url: `${jdyadmin}/waimaoTichengHuilv/updateTichengHuilv`,
		method: 'post',
		data
	})
}

// 删除汇率列表
export function deleteWaimaoHuilvlist(id){
	return request({
		url: `${jdyadmin}/waimaoTichengHuilv/deleteTichengHuilv/${id}`,
		method: 'delete'
	})
}


/**
 * ----------------------------------------------------------
 * ----------------------外贸道氏采购信息---------------------
 * ----------------------------------------------------------
 */
// 新增采购信息
export function addDaoshiCaigou(data){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/addWaimaoDowPurchase`,
		method: 'post',
		data
	})
}

// 导入采购信息
export function importDaoshiCaigou(data){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/addexcleWaimaoDowPurchase`,
		method: 'post',
		data
	})
}

// 查询采购信息
export function getDaoshiCaigou(data){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/seleteWaimaoDowPurchase`,
		method: 'post',
		data
	})
}

// 更新采购信息
export function updateDaoshiCaigou(data){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/updateWaimaoDowPurchase`,
		method: 'post',
		data
	})
}

// 删除采购信息
export function deleteDaoshiCaigou(seid){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/deleteWaimaoDowPurchase/${seid}`,
		method: 'delete'
	})
}

// 根据发票号获取详细信息
export function useIdSearchDetail(id){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/deleteWaimaoFahuo/${id}`,
		method: 'get'
	})
}

// 毛利表
export function maolibiao(data){
	return request({
		url: `${jdyadmin}/waimaoDowPurchase/seleteMaoli`,
    method: 'post',
    data
	})
}

/**
 * ----------------------------------------------------------
 * ----------------------外贸道氏销售信息---------------------
 * ----------------------------------------------------------
 */
// 新增销售信息
export function addDaoshiXiaoshou(data){
	return request({
		url: `${jdyadmin}/waimaoDowMarket/addWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 导入销售信息
export function importDaoshiXiaoshou(data){
	return request({
		url: `${jdyadmin}/waimaoDowMarket/addexcleDowBankExpend`,
		method: 'post',
		data
	})
}

// 查询销售信息
export function getDaoshiXiaoshou(data){
	return request({
		url: `${jdyadmin}/waimaoDowMarket/seleteWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 更新销售信息
export function updateDaoshiXiaoshou(data){
	return request({
		url: `${jdyadmin}/waimaoDowMarket/updateWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 删除销售信息
export function deleteDaoshiXiaoshou(seid){
	return request({
		url: `${jdyadmin}/waimaoDowMarket/deleteWaimaoDowBankExpend/${seid}`,
		method: 'delete'
	})
}

/**
 * ----------------------------------------------------------
 * ----------------------外贸道氏银行收入---------------------
 * ----------------------------------------------------------
 */
// 新增银行收入
export function addDaoshiYinhangIn(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankIncome/addWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 导入银行收入
export function importDaoshiYinhangIn(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankIncome/addexcleDowBankExpend`,
		method: 'post',
		data
	})
}

// 查询银行收入
export function getDaoshiYinhangIn(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankIncome/seleteWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 更新银行收入
export function updateDaoshiYinhangIn(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankIncome/updateWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 删除银行收入
export function deleteDaoshiYinhangIn(seid){
	return request({
		url: `${jdyadmin}/waimaoDowBankIncome/deleteWaimaoDowBankExpend/${seid}`,
		method: 'delete'
	})
}

/**
 * ----------------------------------------------------------
 * ----------------------外贸道氏银行支出---------------------
 * ----------------------------------------------------------
 */
// 新增银行支出
export function addDaoshiYinhangOut(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankExpend/addWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 导入银行支出
export function importDaoshiYinhangOut(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankExpend/addexcleDowBankExpend`,
		method: 'post',
		data
	})
}

// 查询银行支出
export function getDaoshiYinhangOut(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankExpend/seleteWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 更新银行支出
export function updateDaoshiYinhangOut(data){
	return request({
		url: `${jdyadmin}/waimaoDowBankExpend/updateWaimaoDowBankExpend`,
		method: 'post',
		data
	})
}

// 删除银行支出
export function deleteDaoshiYinhangOut(seid){
	return request({
		url: `${jdyadmin}/waimaoDowBankExpend/deleteWaimaoDowBankExpend/${seid}`,
		method: 'delete'
	})
}